package com.example.zqm.git72.Model;

import com.example.zqm.git72.JavaBean.Train;
import com.example.zqm.git72.Service.ActivityService;
import com.example.zqm.git72.Service.ClubService;
import com.example.zqm.git72.Service.TrainService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/4/26.
 */

public class TrainModel {
    private Retrofit retrofit;
    public TrainModel(){

        //联网获取网络上的数据
         retrofit = new Retrofit.Builder()
                .baseUrl("http://172.24.10.175/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public Call getList()
    {
        TrainService trainService=retrofit.create(TrainService.class);
        return trainService.getList();
    }
    public Call getTrainById(String train_id)
    {
        TrainService trainService=retrofit.create(TrainService.class);
        return trainService.getTrainById(train_id);
    }
    public  Call bysearch(String name){
        TrainService trainService =retrofit.create(TrainService.class);
        return  trainService.bysearch(name);
    }
    public  Call ifcollect(String ctrainid,String user_id,int fag){
        TrainService trainService =retrofit.create(TrainService.class);
        return trainService.ifcollect(ctrainid,user_id,fag);
    }
    public  Call iscollect(String train_id,String user_id){
        TrainService trainService =retrofit.create(TrainService.class);
        return trainService.iscollect(train_id,user_id);
    }
    public  Call decollect(String train_id,String user_id){
        TrainService trainService =retrofit.create(TrainService.class);
        return trainService.decollect(train_id,user_id);
    }
    public  Call cotrain(String user_id){
        TrainService trainService =retrofit.create(TrainService.class);
        return trainService.cotrain(user_id);
    }
    public Call signtrain(String participantname,String train_id,String participanttel,String pay,String userid)
    {
        TrainService trainService =retrofit.create(TrainService.class);
        return trainService.signtrain(participantname,train_id,participanttel,pay,userid);
    }

}
